#!/bin/bash

echo 'node version:'
node -v
echo 'npm version:'
npm -v

# 安装npm依赖
npm install

# 构建
npm run build
ret=$?
if [ $ret -ne 0 ];then
  echo "===== build failure ====="
  exit $ret
else
  echo -n "===== build successfully! ====="
fi

# 创建构建目录
mkdir output
rsync -av --exclude='output' --exclude='.git' . output
# tar -czvf output.tar.gz .
